package com.hksj.Intelligentmanagement.mqtt.command;

import lombok.Data;

import java.util.List;

@Data
public class SendMsgData extends BaseMsgData{
    public SendMsgData() {
        setCmd("conn_send_data_echo");
    }

    private Integer devices_num;

    private List<DeviceInfo> devices;

    private Integer send_num = 1;

    private List<SendInfo> send_infos;


    @Data
    public static class DeviceInfo{
        private String addr;
    }

    @Data
    public static class SendInfo{
        private Integer	handle = 14;
        private String type = "request";
        private String raw;
    }

    public DeviceInfo createDeviceInfo(String addr){
        DeviceInfo deviceInfo = new DeviceInfo();
        deviceInfo.setAddr(addr);
        return deviceInfo;
    }

    public SendInfo createSendInfo(String raw){
        SendInfo sendInfo = new SendInfo();
        sendInfo.setRaw(raw);
        return sendInfo;
    }
}
